<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:core="http://www.contact.core.com/contacts/core/ui"
      xmlns:friend="http://www.contact.core.friends.com/contacts/core/friends/ui"
      xmlns:a4j="http://richfaces.org/a4j">
<ui:component>
    <style type="text/css">
        .left {
            float: left;
            vertical-align: middle;
        }

        .right {
            float: right;
            vertical-align: middle;
        }

        .middle {
            vertical-align: middle;

        }
    </style>
    <!--@elvariable id="friend" type="rs.contacts.core.core.searcher.entity.FriendResult"-->
    <!--@elvariable id="reRender" type="java.lang.String"-->
    <h:panelGrid columns="1" style="width:100%">
        <h:panelGrid columns="2" style="width:100%" columnClasses="left, right" rowClasses="middle, middle">
            <core:pictureForViewWithName style="resize:both; width: 60px;"
                                         columns="2"
                                         pictureKey="photoprofile_#{friend.id}"
                                         informationId="#{friend.id}"
                                         fullName="#{friend.firstName} #{friend.lastName}"
                                         additionalText="#{friend.requestStatus eq 'REQUEST'?'Waitting Approval..':''}"/>
            <a4j:outputPanel layout="block"
                             style="width:30px; border-left:1px solid gray; padding-left:5px; text-align:left;">
                <a4j:outputPanel rendered="#{friend.requestStatus eq 'REQUEST'}" layout="block">
                    <a4j:commandButton styleClass="button"
                                       image="./style/images/removeBig.PNG"
                                       action="#{newFriendBean.rejectRequest}"
                                       reRender="#{reRender}">
                          <rich:toolTip direction="bottom-right" value="Remove"/>
                        <f:setPropertyActionListener value="#{friend.id}"
                                                     target="#{newFriendBean.informationIdForProccess}"/>
                    </a4j:commandButton>
                </a4j:outputPanel>

                <a4j:outputPanel rendered="#{friend.requestStatus eq 'CONFIRM'}" layout="block">
                    <h:panelGrid columns="2">
                        <a4j:commandButton image="./style/images/acceptBig.PNG"
                                           action="#{newFriendBean.confirmRequest}"
                                           reRender="#{reRender}">
                            <f:setPropertyActionListener value="#{friend.id}"
                                                         target="#{newFriendBean.informationIdForProccess}"/>
                        </a4j:commandButton>

                        <a4j:commandButton image="./style/images/removeBig.PNG"
                                           action="#{newFriendBean.rejectRequest}"
                                           reRender="#{reRender}">
                              <rich:toolTip direction="bottom-right" value="Remove"/>
                            <f:setPropertyActionListener value="#{friend.id}"
                                                         target="#{newFriendBean.informationIdForProccess}"/>
                        </a4j:commandButton>
                    </h:panelGrid>


                </a4j:outputPanel>

                <a4j:outputPanel rendered="#{friend.requestStatus eq 'ACCEPT' or
            friend.requestStatus eq 'NOTIF'}" layout="block">
                    <a4j:commandButton styleClass="button"
                                       image="./style/images/removeBig.PNG"
                                       action="#{newFriendBean.rejectRequest}"
                                       reRender="#{reRender}">
                          <rich:toolTip direction="bottom-right" value="Remove"/>
                        <f:setPropertyActionListener value="#{friend.id}"
                                                     target="#{newFriendBean.informationIdForProccess}"/>
                    </a4j:commandButton>
                </a4j:outputPanel>
            </a4j:outputPanel>

        </h:panelGrid>
        <rich:separator height="1px" width="100%" style="margin:3px;"/>
    </h:panelGrid>

    <!--<a4j:outputPanel layout="block" style="width:100%; vertical-align:middle;">-->
    <!--<a4j:outputPanel layout="block" style="float:left; ">-->
    <!--<h:graphicImage value="./style/images/noImage.PNG" style="resize:both; width: 60px;"/>-->
    <!---->
    <!--</a4j:outputPanel>-->
    <!--<a4j:outputPanel layout="block" style="float:left;">-->
    <!--<h:commandLink value="#{friend.firstName} #{friend.lastName}" action="#{accountBean.friendProfile}">-->
    <!--<f:setPropertyActionListener value="#{friend}"-->
    <!--target="#{accountBean.friendResult}"/>-->
    <!--</h:commandLink>-->
    <!--</a4j:outputPanel>-->
    <!---->
    <!--</a4j:outputPanel>-->
</ui:component>


</html>
